import request from "../request";

export function soilTime(params) {  //土壤传感器实时数据
    return request({
        url: 'iotbase/sensor/soil/data/nowest/' + params.deviceId,
        method: 'GET',
    })
}

export function soilGoodDay(params) {  //土壤优质天数
    return request({
        url: '/iotbase/sensor/soil/conductivity/statistics',
        method: 'GET',
        params
    })
}

export function rainTime(params) {  //雨量传感器实时数据
    return request({
        url: '/iotbase/sensor/rainfall/data/nowest/' + params.deviceId,
        method: 'GET',
    })
}

export function soilSeven(params) {  //近七天土壤盐碱化环境指数等级
    return request({
        url: 'iotbase/sensor/soil/data/analyse/trend',
        method: 'GET',
        params:params
    })
}

export function airTime(params) {  //空气传感器实时数据
    return request({
        url: 'iotbase/sensor/air/data/nowest/' + params.deviceId,
        method: 'GET',
    })
}

export function airGoodDay(params){  //空气传感器优质天数
    return request({
        url: '/iotbase/sensor/air/pm25/statistics',
        method: 'GET',
        params
    })
}

export function airSeven(params) {  //近七天空气质量环境指数等级
    return request({
        url: 'iotbase/sensor/air/data/analyse/trend',
        method: 'GET',
        params:params
    })
}

export function anionTime(params) {  //负氧离子实时数据
    return request({
        url: 'iotbase/sensor/air/data/nowest/' + params.deviceId,
        method: 'GET',
    })
}

export function tvocGoodDay(params) {  //负氧离子优质天数
    return request({
        url: '/iotbase/sensor/air/tvoc/statistics',
        method: 'GET',
        params
    })
}

export function waterTime(params) {  //水质传感器实时数据
    return request({
        url: 'iotbase/sensor/water/data/nowest/' + params.deviceId,
        method: 'GET',
        header:{'Tenant-id':10100}
    })
}

export function waterGoodDay(params) {  //水质传感器实时数据
    return request({
        url: '/iotbase/sensor/water/index/statistics',
        method: 'GET',
        params
    })
}

export function waterSeven(params) {  //近七天地表水环境指数等级
    return request({
        url: 'iotbase/sensor/water/data/analyse/trend',
        method: 'GET',
        params:params,
        header:{'Tenant-id':10100}
    })
}

export function treeNums() {  //园区内种植各类型苗木数量
    return request({
        url: 'ecosystem/plant/number',
        method: 'GET',
        header:{'Tenant-id':10100}
    })
}

export function treeTop5() {  //各个园区场馆种植苗木数量TOP5
    return request({
        url: 'ecosystem/plant/plant/ranking',
        method: 'GET',
        header:{'Tenant-id':10100}
    })
}

export function todayThing(params) {  //当日安防事件分析
    return request({
        url: 'incident/event/cockpit/public/queryPublicIssue/' + params.type,
        method: 'GET',
        header:{'Tenant-id':10100},
        params:params.data
    })
}

export function sevenThing(params) {  //近七天安防事件分析
    return request({
        url: 'incident/event/cockpit/public/querySevenAnalysis/' + params.type,
        method: 'GET',
        header:{'Tenant-id':10100}
    })
}

export function todayAf(params) {  //当日事件数据统计
    return request({
        url: 'incident/event/cockpit/public/queryIncidentAnalysis/' + params.type,
        method: 'GET',
        header:{'Tenant-id':10100}
    })
}

export function rainDevice(params) {  //获取雨量传感器
    return request({
        url: '/iotbase/device/all',
        method: 'GET',
        header:{'Tenant-id':10100},
        params:params
    })
}

export function rainData(params) {  //雨量传感器 7天数据
    return request({
        url: '/iotbase/sensor/rainfall/data/analyse/trend',
        method: 'GET',
        header:{'Tenant-id':10100},
        params:params
    })
}
export function PM(params) {  //pm2.5 指数
    return request({
        url: '/iotbase/sensor/air/data/nowest/' + params,
        method: 'GET',
    })
}

export function airWeek(params) {  //近七天空气
    return request({
        url: '/iotbase/sensor/air/data/analyse/contrast/',
        method: 'GET',
        params:params
    })
}
